package view;


import javax.swing.JFrame;
import javax.swing.SpringLayout;
import javax.swing.JSeparator;
import javax.swing.JTabbedPane;
import javax.swing.JPanel;
import javax.swing.SwingConstants;
import javax.swing.JLabel;
import javax.swing.JCheckBox;
import javax.swing.JButton;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.table.DefaultTableModel;

/*
 * GUI
 */
public class Purchase_Department extends JFrame {
	private JTable table;
	public Purchase_Department() {
		SpringLayout springLayout = new SpringLayout();
		getContentPane().setLayout(springLayout);
		
		JSeparator separator = new JSeparator();
		springLayout.putConstraint(SpringLayout.NORTH, separator, 86, SpringLayout.NORTH, getContentPane());
		springLayout.putConstraint(SpringLayout.WEST, separator, 10, SpringLayout.WEST, getContentPane());
		springLayout.putConstraint(SpringLayout.SOUTH, separator, 88, SpringLayout.NORTH, getContentPane());
		springLayout.putConstraint(SpringLayout.EAST, separator, -10, SpringLayout.EAST, getContentPane());
		getContentPane().add(separator);
		
		JSeparator separator_1 = new JSeparator();
		
		
		
		JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP);
		springLayout.putConstraint(SpringLayout.NORTH, tabbedPane, 6, SpringLayout.SOUTH, separator);
		springLayout.putConstraint(SpringLayout.WEST, tabbedPane, 10, SpringLayout.WEST, getContentPane());
		springLayout.putConstraint(SpringLayout.SOUTH, tabbedPane, -150, SpringLayout.SOUTH, getContentPane());
		springLayout.putConstraint(SpringLayout.EAST, tabbedPane, -14, SpringLayout.EAST, separator);
		getContentPane().add(tabbedPane);
		
		
		springLayout.putConstraint(SpringLayout.WEST, separator_1, 10, SpringLayout.WEST, getContentPane());
		springLayout.putConstraint(SpringLayout.SOUTH, separator_1, 57, SpringLayout.SOUTH, tabbedPane);
		springLayout.putConstraint(SpringLayout.EAST, separator_1, -10, SpringLayout.EAST, getContentPane());
		getContentPane().add(separator_1);
		
		JPanel panel = new JPanel();
		tabbedPane.addTab("STATUS", null, panel, null);
		
		JPanel panel_1 = new JPanel();
		tabbedPane.addTab("PURCHASE ORDER", null, panel_1, null);
		SpringLayout sl_panel_1 = new SpringLayout();
		panel_1.setLayout(sl_panel_1);
		
		JSeparator separator_2 = new JSeparator();
		sl_panel_1.putConstraint(SpringLayout.NORTH, separator_2, 0, SpringLayout.NORTH, panel_1);
		sl_panel_1.putConstraint(SpringLayout.SOUTH, separator_2, 0, SpringLayout.SOUTH, panel_1);
		sl_panel_1.putConstraint(SpringLayout.EAST, separator_2, -417, SpringLayout.EAST, panel_1);
		separator_2.setOrientation(SwingConstants.VERTICAL);
		panel_1.add(separator_2);
		
		JLabel lblIndent = new JLabel("INDENT 1");
		sl_panel_1.putConstraint(SpringLayout.NORTH, lblIndent, 36, SpringLayout.NORTH, panel_1);
		sl_panel_1.putConstraint(SpringLayout.WEST, lblIndent, 24, SpringLayout.WEST, panel_1);
		panel_1.add(lblIndent);
		
		JLabel lblIndent_1 = new JLabel("INDENT 2");
		sl_panel_1.putConstraint(SpringLayout.NORTH, lblIndent_1, 30, SpringLayout.SOUTH, lblIndent);
		sl_panel_1.putConstraint(SpringLayout.WEST, lblIndent_1, 0, SpringLayout.WEST, lblIndent);
		panel_1.add(lblIndent_1);
		
		JLabel lblIndent_2 = new JLabel("INDENT 3");
		sl_panel_1.putConstraint(SpringLayout.WEST, lblIndent_2, 0, SpringLayout.WEST, lblIndent);
		panel_1.add(lblIndent_2);
		
		JCheckBox chckbxNewCheckBox = new JCheckBox("");
		sl_panel_1.putConstraint(SpringLayout.WEST, separator_2, 61, SpringLayout.EAST, chckbxNewCheckBox);
		sl_panel_1.putConstraint(SpringLayout.NORTH, chckbxNewCheckBox, -4, SpringLayout.NORTH, lblIndent);
		sl_panel_1.putConstraint(SpringLayout.WEST, chckbxNewCheckBox, 37, SpringLayout.EAST, lblIndent);
		panel_1.add(chckbxNewCheckBox);
		
		JCheckBox chckbxNewCheckBox_1 = new JCheckBox("");
		sl_panel_1.putConstraint(SpringLayout.NORTH, chckbxNewCheckBox_1, -4, SpringLayout.NORTH, lblIndent_1);
		panel_1.add(chckbxNewCheckBox_1);
		
		JCheckBox chckbxNewCheckBox_2 = new JCheckBox("");
		sl_panel_1.putConstraint(SpringLayout.NORTH, chckbxNewCheckBox_2, 25, SpringLayout.SOUTH, chckbxNewCheckBox_1);
		sl_panel_1.putConstraint(SpringLayout.EAST, chckbxNewCheckBox_1, 0, SpringLayout.EAST, chckbxNewCheckBox_2);
		sl_panel_1.putConstraint(SpringLayout.NORTH, lblIndent_2, 4, SpringLayout.NORTH, chckbxNewCheckBox_2);
		sl_panel_1.putConstraint(SpringLayout.WEST, chckbxNewCheckBox_2, 0, SpringLayout.WEST, chckbxNewCheckBox);
		panel_1.add(chckbxNewCheckBox_2);
		
		JScrollPane scrollPane = new JScrollPane();
		sl_panel_1.putConstraint(SpringLayout.NORTH, scrollPane, 2, SpringLayout.NORTH, panel_1);
		sl_panel_1.putConstraint(SpringLayout.WEST, scrollPane, 10, SpringLayout.WEST, separator_2);
		sl_panel_1.putConstraint(SpringLayout.SOUTH, scrollPane, -2, SpringLayout.SOUTH, panel_1);
		sl_panel_1.putConstraint(SpringLayout.EAST, scrollPane, -10, SpringLayout.EAST, panel_1);
		panel_1.add(scrollPane);
		
		table = new JTable();
		table.setModel(new DefaultTableModel(
			new Object[][] {
			},
			new String[] {
				"NO.", "ITEM CODE", "ITEM DESCRIPTION", "REQUIREMENT", "BALANCE", "PURCHASE", "TIME SCHEDULE"
			}
		) {
			boolean[] columnEditables = new boolean[] {
				false, false, false, false, false, false, false
			};
			public boolean isCellEditable(int row, int column) {
				return columnEditables[column];
			}
		});
		scrollPane.setViewportView(table);
		
		JButton btnNext = new JButton("NEXT");
		springLayout.putConstraint(SpringLayout.NORTH, btnNext, 16, SpringLayout.SOUTH, tabbedPane);
		springLayout.putConstraint(SpringLayout.EAST, btnNext, 0, SpringLayout.EAST, tabbedPane);
		getContentPane().add(btnNext);
	}
	/*
	 * ---------------------------------------------------------------------------------------
	 */
}
